#include <stdio.h>

/**
 * 汉诺塔移动，借助trans将n层汉诺塔从from移动到to
 */
void move(int n, char from, char trans, char to)
{
    if (n == 1)
    {
        printf("%c -> %c\n", from, to);
    }
    else
    {
        move(n - 1, from, to, trans);
        printf("%c -> %c\n", from, to);
        move(n - 1, trans, from, to);
    }
}

int main(void)
{
    move(3, 'A', 'B', 'C');
    return 0;
}
